package org.example.item.model.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.example.misc.model.CommonEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 * 前台类目关系表
 */
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "category_relation")
@org.hibernate.annotations.Table(appliesTo = "category_relation", comment = "类目关系")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CategoryRelation {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false)
    private Long id;

    @Column
    private Long backGroundCategoryId;
    @Column
    private String backGroundCategoryName;
    @Column
    private Long foreGroundCategoryId;
    @Column
    private String foreGroundCategoryName;

    @Embedded
    private CommonEntity commonEntity;
}
